-- GENERATED SPELL FOR [Highlord Darion Mograine] --


function spell0_29173(pUnit, Event) --@Anti-Magic Zone,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(52893,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_29173', 1, 1)
end

function spell1_29173(pUnit, Event) --@Death Strike,n/a--
pUnit:FullCastSpellOnTarget(53639,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29173', 21000, 1)
end

function spell2_29173(pUnit, Event) --@Death\'s Embrace,Self--
pUnit:FullCastSpellOnTarget(53635,pUnit)
pUnit:RegisterEvent('Sorts_29173', 605, 1)
end

function spell3_29173(pUnit, Event) --@Icy Touch,n/a--
pUnit:FullCastSpellOnTarget(49723,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29173', 8321, 1)
end

function spell4_29173(pUnit, Event) --@The Light of Dawn,Self--
pUnit:FullCastSpellOnTarget(53658,pUnit)
pUnit:RegisterEvent('Sorts_29173', 555, 1)
end

function spell5_29173(pUnit, Event) --@The Might of Mograine,n/a--
pUnit:FullCastSpellOnTarget(53642,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_29173', 0, 1)
end

function spell6_29173(pUnit, Event) --@Unholy Blight,Self--
pUnit:FullCastSpellOnTarget(53640,pUnit)
pUnit:RegisterEvent('Sorts_29173', 0, 1)
end

function Sorts_29173(pUnit, Event)
local choix_sorts_29173 = math.random(0, 6)
if choix_sorts_29173 == 0 then
pUnit:RegisterEvent('spell0_29173', 1, 1)
end
if choix_sorts_29173 == 1 then
pUnit:RegisterEvent('spell1_29173', 1, 1)
end
if choix_sorts_29173 == 2 then
pUnit:RegisterEvent('spell2_29173', 1, 1)
end
if choix_sorts_29173 == 3 then
pUnit:RegisterEvent('spell3_29173', 1, 1)
end
if choix_sorts_29173 == 4 then
pUnit:RegisterEvent('spell4_29173', 1, 1)
end
if choix_sorts_29173 == 5 then
pUnit:RegisterEvent('spell5_29173', 1, 1)
end
if choix_sorts_29173 == 6 then
pUnit:RegisterEvent('spell6_29173', 1, 1)
end
end

function mob29173_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_29173', math.random(1500, 3000), 1)
end

function mob29173_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob29173_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob29173_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(29173, 1, 'mob29173_Action')
RegisterUnitEvent(29173, 2, 'mob29173_Leave')
RegisterUnitEvent(29173, 3, 'mob29173_Kill')
RegisterUnitEvent(29173, 4, 'mob29173_Die')
